package org.grayrabbit.cms.publish.module;

import org.grayrabbit.cloud.core.biz.BizAbstractModule;
import org.grayrabbit.cloud.core.biz.ClientUtility;
import org.grayrabbit.cloud.core.config.ConfiguratorException;
import org.grayrabbit.cloud.core.module.ModuleException;
import org.grayrabbit.cloud.core.rpc.Argument;
import org.grayrabbit.cloud.core.rpc.Result;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

public class PublishModule extends BizAbstractModule{
	private Logger log = LoggerFactory.getLogger(PublishModule.class);

	public Result submit(Argument argument) throws ModuleException {
		String channel="channel";
		try {
			channel=ClientUtility.getProperty("module", "publish", "depend");
			log.debug("publish channel is :{}",channel);
		} catch (ConfiguratorException e) {
			log.error("read module channel error :{},use the defaut channel is channel",e);
		}
		return ClientUtility.submit(channel, argument);
	}

}
